<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>opacity</title>
  <style>
    * {
      margin: 0;
      padding: 0;
    }
    .box1 {
      width: 200px;
      height: 200px;
      background-color: orange;
      padding: 5px;
      opacity: 0.1;
    }
    .box2 {
      position: relative;
    }
    h1 {
       position: absolute;
       width: 400px;
       top: 100px;
       left: 0;
       background-color: black;
       color: white;
       /* 文字居中 */
       line-height: 100px;
       text-align: center;
       font-size: 40px;
       opacity: 0.5;
    }

  </style>
</head>
<body>
  <div class="box1">你好啊</div>
  <div class="box2">
    <img src="../../images/你瞅啥.jpg">
    <h1>你瞅啥</h1>
  </div>
  
</body>
</html>